Skip to content

Add an error message in case of invalid configured dependency mbedTLS. #3364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2019

Conversation

Boldie
Copy link
Contributor

@Boldie Boldie commented Oct 15, 2019

Especially if the user wants to use the library as component in IDF,
there are some pitfalls while doing make menuconfig. One is this missing
dependency which will now fail with a better error message with a hint to
the user how to fix it.

refs #2154 #3215

Especially if the user wants to use the library as component in IDF,
there are some pitfalls while doing make menuconfig. One is this missing
dependency which will now fail with a better error message with a hint to
the user how to fix it.

refs espressif#2154 espressif#3215
@@ -19,6 +19,9 @@
#include "ssl_client.h"
#include "WiFi.h"

#ifndef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need to be prefixed with CONFIG_... But I don't see this key on IDF v3.2 or IDF v3.3.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONFIG_MBEDTLS_PSK_MODES and CONFIG_MBEDTLS_TLS_ENABLED would be better to check for here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not quite easy to handle with the CONFIG_* definitions because internally the library will use a lot of things together (the basic config must be set + at least one cipher must be selected) to enable this function. So I choose to use the library definition which really enables the function to not have duplicate logic in there.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is the define you have used will never exist, regardless of sdkconfig entries selected. If you switch to the CONFIG_XXX entries I posted above it will at least compile for test cases.

But you are right, there is still the requirement to have at least one key exchange format enabled which will require explicit checking for the various keys used by the code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually digging into this further it looks like MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED would be defined internally by mbedTLS. It is not clear though why the GitHub Actions failed. @me-no-dev can you retrigger them?

@me-no-dev me-no-dev merged commit 91e095f into espressif:master Oct 17, 2019
@me-no-dev
Copy link
Member

done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants